import request from '@/utils/request'

// 登录方法
export function login(username, password) {
  const data = {
    username,
    password
  }
  return request({
    url: '/auth/app/login',
    method: 'post',
    data: data
  })
}

export function loginProvince(data) {
  return request({
    url: '/auth/app/identityLogin',
    method: 'get',
    data: data
  })
}
export function loginProvinceCode(data) {
  return request({
    url: '/auth/app/getIdentityInfo',
    method: 'get',
    data: data
  })
}

export function loginWithWX(code) {
  return request({
    url: '/auth/app/wxlogin?code='+code,
    method: 'get'
  })
}

// 获取用户详细信息
export function getInfo(id) {
  return request({
    url: '/cms/web/members/'+id,
    method: 'get'
  })
}

// 获取用户详细信息
export function getInfoByWeixin(openid) {
  return request({
    url: '/members/memberInfo/'+openid,
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

 // 修改密码
export function updatePassword(data) {
  return request({
    url: '/auth/web/updatepassword',
    method: 'post',
	data:data
  })
}

 // 修改手机号
export function updateMobile(data) {
  return request({
    url: '/auth/web/mobileupdate',
    method: 'post',
	data:data
  })
}

//上传文件
export function uploadFile(){
	return request({
	  url: '/file/upload',
	  method: 'post',
		data:data
	})
}
